﻿
alter view dbo.ERPStoreOffersOfferedProduct
As
Select 
EntitySelectionDetail.Id as Id
, InternalEntityId as ProductId
, EntitySelectionDetail.EntitySelectionId as SelectionId
, ERPStoreOffersEntitySelectedDetailExtension.SalePrice
, ERPStoreOffersEntitySelectedDetailExtension.IsStrikedPrice
, ERPStoreOffersEntitySelectedDetailExtension.Discount
, ERPStoreOffersEntitySelectedDetailExtension.SaleFactor
From EntitySelection
		join EntitySelectionDetail on EntitySelection.Id = EntitySelectionDetail.EntitySelectionId
		left join ERPStoreOffersEntitySelectedDetailExtension on EntitySelectionDetail.Id = ERPStoreOffersEntitySelectedDetailExtension.ERPStoreOffersEntitySelectedDetailExtensionId
where EntitySelection.EntityNameBase = 'Product'
Go
